<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>
<body>
    <script>
        const str="tw";
        console.log(typeof str);
        console.log(typeof  Number(str));

        //数字转为字符串
        let num=999;
        //第一种方法
        const str1=num+"";
        
        console.log(typeof str1);//string
        console.log(typeof String(num));//string
        //2中
        const num2=99;
        const newstr=num2.toString();
        console.log(typeof newstr);
        
        //转换:如果开头是数字的话
        const string="99845swdfaef";
        console.log( typeof parseInt(string));//number 把开头的数字提取出来转换为数字类型

        //分割字符串
        const str_split="cdtw.com";
        console.log(str_split.split(""));//中间填写以什么分割
        console.log(str_split.split("w"));//['cdt', '.com']

         //join
         let table=["1","2",250,"tw"];
         console.log(table.join("*"));//1*2*250*tw

    </script>
</body>
</html>